<?php

namespace app\robot\controller;

use app\model\Base;
use support\Redis;
use support\Request;

class userrelateController
{

    public function searchtelbybase64(Request $request)
    {

        

        $post = $request->post();

        $host = getenv("host");

        $url = "{$host}robot/userrelate/searchtelbybase64";

        $rt = Base::curlpostdata($url, json_encode($post));

        $rdata = json_encode($rt, JSON_UNESCAPED_UNICODE);

        $response = response();

        return $response->withBody($rdata);
    }


    public function searchtelbyfaceurl(Request $request)
    {

        $post = $request->all();


        $host = getenv("host");

        $url = "{$host}robot/userrelate/searchtelbyfaceurl";


        $rt = Base::curlpostdata($url, $post);
        $rdata = json_encode($rt, JSON_UNESCAPED_UNICODE);

        $response = response();

        return $response->withBody($rdata);
    }


    public function studentlogin(Request $request)
    {



        $post = $request->all();


        $host = getenv("host");

        $url = "{$host}robot/userrelate/studentlogin";


        $rt = Base::curlpostdata($url, $post);
        $rdata = json_encode($rt, JSON_UNESCAPED_UNICODE);


        $response = response();

        return $response->withBody($rdata);
    }

    public function view(Request $request)
    {
        return view('index/view', ['name' => 'webman']);
    }

    public function json(Request $request)
    {
        return json(['code' => 0, 'msg' => 'ok']);
    }
}
